home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / GXPrinterDrivers.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  42.0 KB  |  1,123 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        GXPrinterDrivers.h
  3.  
  4.      Contains:    This file defines data types and API functions for printer driver development.
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __GXPRINTERDRIVERS__
  18. #define __GXPRINTERDRIVERS__
  19.  
  20. #ifndef __SCALERSTREAMTYPES__
  21. #include <ScalerStreamTypes.h>
  22. #endif
  23. #ifndef __GXMESSAGES__
  24. #include <GXMessages.h>
  25. #endif
  26. #ifndef __PRINTING__
  27. #include <Printing.h>
  28. #endif
  29. #ifndef __GXPRINTING__
  30. #include <GXPrinting.h>
  31. #endif
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. /* ------------------------------------------------------------------------------
  56.  
  57.                         Desktop Printer Constants and Types
  58.  
  59. -------------------------------------------------------------------------------- */
  60. /* Manual feed alert preferences structure for gxManualFeedAlertPrefsType desktop printer resource */
  61.  
  62. struct gxManualFeedAlertPrefs {
  63.     long                             alertFlags;                    /*    Flags--first word is for driver's private use, the rest is predefined. */
  64. };
  65. typedef struct gxManualFeedAlertPrefs    gxManualFeedAlertPrefs;
  66. typedef gxManualFeedAlertPrefs *        gxManualFeedAlertPrefsPtr;
  67. typedef gxManualFeedAlertPrefsPtr *        gxManualFeedAlertPrefsHdl;
  68. /* Constants for the alertFlags field of gxManualFeedAlertPrefs.*/
  69.  
  70. enum {
  71.     gxShowAlerts                = 0x00000001,                    /* Show alerts for this desktop printer. */
  72.     gxAlertOnPaperChange        = 0x00000002                    /* …only if the papertype changes. */
  73. };
  74.  
  75.  
  76. enum {
  77.     gxDefaultMFeedAlertSettings    = (gxShowAlerts | gxAlertOnPaperChange)
  78. };
  79.  
  80.  
  81. /* Driver output settings structure for desktop printer gxDriverOutputType resource */
  82.  
  83. struct gxDriverOutputSettings {
  84.     long                             driverflags;                /*    Flags -- for use by driver. */
  85.     long                             outputSettings;                /*    Flags -- predefined. */
  86. };
  87. typedef struct gxDriverOutputSettings    gxDriverOutputSettings;
  88. typedef gxDriverOutputSettings *        gxDriverOutputSettingsPtr;
  89. typedef gxDriverOutputSettingsPtr *        gxDriverOutputSettingsHdl;
  90. /* Constants for the outputSettings field of gxDriverOutputSettings. */
  91.  
  92. enum {
  93.     gxCanConfigureTrays            = 0x00000001                    /* Desktop printer represents a device with a paper feed. */
  94. };
  95.  
  96. /* ------------------------------------------------------------------------------
  97.  
  98.                         Printing Driver Constants and Types
  99.  
  100. -------------------------------------------------------------------------------- */
  101.  
  102. enum {
  103.     gxInputTraysMenuItem        = -1                            /* Menu item number for "Input Trays..." */
  104. };
  105.  
  106.  
  107. /* Buffering and IO preferences-- this structure mirrors the 'iobm' resource */
  108.  
  109. struct gxIOPrefsRec {
  110.     unsigned long                     communicationsOptions;        /* Standard or nonstandard I/O? */
  111.     unsigned long                     numBuffers;                    /* Requested number of buffers for QDGX to create */
  112.     unsigned long                     bufferSize;                    /* The size of each buffer */
  113.     unsigned long                     numReqBlocks;                /* The number of async I/O request blocks which will be needed */
  114.     unsigned long                     openCloseTimeout;            /* The open/close timeout (in ticks) */
  115.     unsigned long                     readWriteTimeout;            /* The read/write timeout (in ticks) */
  116. };
  117. typedef struct gxIOPrefsRec                gxIOPrefsRec;
  118.  
  119. typedef gxIOPrefsRec *                    gxIOPrefsPtr;
  120. typedef gxIOPrefsPtr *                    gxIOPrefsHdl;
  121. /* Constants for the communicationsOptions field of IOPrefsRec. */
  122.  
  123. enum {
  124.     gxUseCustomIO                = 0x00000001                    /* Driver uses a non-standard IO mechanism */
  125. };
  126.  
  127.  
  128. /* Information about writing to a file */
  129.  
  130. struct gxPrintDestinationRec {
  131.     Boolean                         printToFile;                /* True if output is to go to a file */
  132.     char                             padByte;
  133.     FSSpec                             fSpec;                        /* If going to a file, the FSSpec for the file */
  134.     char                             includeFonts;                /* True if fonts are to be included */
  135.     char                             pad2;
  136.     Str31                             fileFormat;                    /* Format to write file */
  137. };
  138. typedef struct gxPrintDestinationRec    gxPrintDestinationRec;
  139.  
  140. typedef gxPrintDestinationRec *            gxPrintDestinationPtr;
  141. typedef gxPrintDestinationPtr *            gxPrintDestinationHdl;
  142. /* This structure is the content of each cell in the standard PACK LDEF */
  143.  
  144. struct gxPortListRec {
  145.     char                             firstMarker;                /* Markers to indicate icon or non-icon version */
  146.     char                             secondMarker;                /* if these are ≈ and ≈, then the cell is an icon cell. */
  147.                                                                 /* Otherwise, it is assumed to be a standard text LDEF */
  148.                                                                 /* cell */
  149.  
  150.     Handle                             iconSuiteHandle;            /* The icon suite to draw for this cell */
  151.     Handle                             outputDriverName;            /* Handle to the output driver name (for serial) */
  152.     Handle                             inputDriverName;            /* Handle to the input driver name (for serial) */
  153.     Str255                             iconName;                    /* Name to draw under the icon */
  154. };
  155. typedef struct gxPortListRec            gxPortListRec;
  156.  
  157. typedef gxPortListRec *                    gxPortListPtr;
  158. /* ------------------------------------------------------------------------------
  159.  
  160.                         Printing Driver Constants for resources in the desktop printer
  161.  
  162. -------------------------------------------------------------------------------- */
  163.  
  164. enum {
  165.     gxDeviceCommunicationsID    = 0
  166. };
  167.  
  168.  
  169. /* ----------------------------------• 'prod' •---------------------------------- */
  170. /*
  171.       For PostScript devices, the device and version names of the device.
  172.       (0) product name is of type PString
  173.       (1) version is of type PString
  174.       (2) revision is of type PString
  175.       (3) vm available is of type long
  176.       (4) font stream type is of type scalerStreamTypeFlag
  177.       (5) language level is of type long
  178. */
  179.  
  180.  
  181. enum {
  182.     gxPostscriptProductInfoType    = FOUR_CHAR_CODE('prod'),
  183.     gxPostscriptProductNameID    = 0,
  184.     gxPostscriptVersionID        = 1,
  185.     gxPostscriptRevisionID        = 2,
  186.     gxPostscriptVMAvailableID    = 3,
  187.     gxPostscriptFontStreamTypeID = 4,
  188.     gxPostscriptLanguageLevelID    = 5
  189. };
  190.  
  191.  
  192. /* PPD support definitions*/
  193.  
  194. enum {
  195.     gxPPDInformationTag            = FOUR_CHAR_CODE('ppda'),        /* tag used for job collection*/
  196.     gxPPDInformationTagID        = gxPrintingTagID                /* ID for job collection tag*/
  197. };
  198.  
  199.  
  200. enum {
  201.     gxPPDInformationType        = gxPPDInformationTag,            /* rsource type as stored in desktop printer*/
  202.     gxPPDInformationResID        = gxPrintingDriverBaseID        /* ID of rsource stored in desktop printer*/
  203. };
  204.  
  205.  
  206. struct gxPPDFileInfoRec {
  207.     unsigned long                     dataOffset;                    /* byte offset to beginning of ppd data*/
  208.     unsigned long                     dataLength;                    /* length of ppd data*/
  209.     unsigned long                     reserved;                    /* reserved*/
  210.     unsigned long                     aliasRecordSize;            /* size of alias record below*/
  211.     unsigned char                     ppdAlias[1];                /* the actual alias record data*/
  212. };
  213. typedef struct gxPPDFileInfoRec            gxPPDFileInfoRec;
  214.  
  215. typedef gxPPDFileInfoRec *                gxPPDFileInfoPtr;
  216. typedef gxPPDFileInfoPtr *                gxPPDFileInfoHdl;
  217. /* ------------------------------------------------------------------------------
  218.  
  219.                         Printing Driver Constants for status alerts
  220.  
  221. -------------------------------------------------------------------------------- */
  222.  
  223. /* Structure passed in statusBuffer of StatusRecord for manual feed alert */
  224.  
  225. struct gxManualFeedRecord {
  226.     Boolean                         canAutoFeed;                /* True if driver can switch to auto feed */
  227.     char                             pad1;
  228.     Str31                             paperTypeName;                /* Name of paperType to feed manually */
  229. };
  230. typedef struct gxManualFeedRecord        gxManualFeedRecord;
  231.  
  232. /* Structure passed in statusBuffer of StatusRecord for out of paper alert */
  233.  
  234. struct gxOutOfPaperRecord {
  235.     Str31                             paperTypeName;                /* Name of printing document */
  236. };
  237. typedef struct gxOutOfPaperRecord        gxOutOfPaperRecord;
  238.  
  239. /* The DITL id for the auto feed button in the manual feed alert */
  240.  
  241. enum {
  242.     gxAutoFeedButtonId            = 3
  243. };
  244.  
  245.  
  246. /* Status resource id for the alerts */
  247.  
  248. enum {
  249.     gxUnivAlertStatusResourceId    = -28508
  250. };
  251.  
  252.  
  253. /* Status resource indices for alerts */
  254.  
  255. enum {
  256.     gxUnivSetTrayIndex            = 0,
  257.     gxUnivManualFeedIndex        = 2,
  258.     gxUnivFailToPrintIndex        = 3,
  259.     gxUnivPaperJamIndex            = 4,
  260.     gxUnivOutOfPaperIndex        = 5,
  261.     gxUnivNoPaperTrayIndex        = 6,
  262.     gxUnivPrinterReadyIndex        = 7,
  263.     gxUnivAlertBeforeIndex        = 9,
  264.     gxUnivAlertAfterIndex        = 10
  265. };
  266.  
  267.  
  268. /* Allocation sizes for status buffers needed for automatic alerts */
  269.  
  270. enum {
  271.     gxDefaultStatusBufferSize    = 10,
  272.     gxManualFeedStatusBufferSize = 34,
  273.     gxOutOfPaperStatusBufferSize = 42
  274. };
  275.  
  276.  
  277. /* ------------------------------------------------------------------------------
  278.  
  279.                                 Old Application Support
  280.  
  281. -------------------------------------------------------------------------------- */
  282. /* The format of a 'cust' resource  */
  283.  
  284. struct gxCustomizationRec {
  285.     short                             horizontalResolution;        /* Horizontal res (integral part) */
  286.     short                             verticalResolution;            /* Vertical res (integral part) */
  287.     short                             upDriverType;                /* "upDriver" emulation type */
  288.     Point                             patternStretch;                /* Pattern stretch factor */
  289.     short                             translatorSettings;            /* Translator settings to use */
  290. };
  291. typedef struct gxCustomizationRec        gxCustomizationRec;
  292.  
  293. typedef gxCustomizationRec *            gxCustomizationPtr;
  294. typedef gxCustomizationPtr *            gxCustomizationHdl;
  295. /* The format of a 'resl' resource */
  296.  
  297. struct gxResolutionRec {
  298.     short                             rangeType;                    /* Always 1 */
  299.     short                             xMinimumResolution;            /* Min X resolution available */
  300.     short                             xMaximumResolution;            /* Max X resolution available */
  301.     short                             yMinimumResolution;            /* Min Y resolution available */
  302.     short                             yMaximumResolution;            /* Max Y resolution available */
  303.     short                             resolutionCount;            /* Number of resolutions */
  304.     Point                             resolutions[1];                /* Array of resolutions */
  305. };
  306. typedef struct gxResolutionRec            gxResolutionRec;
  307.  
  308. typedef gxResolutionRec *                gxResolutionPtr;
  309. typedef gxResolutionPtr *                gxResolutionHdl;
  310. /*
  311.  
  312.         Constants for the "universal" print record.
  313.  
  314. */
  315. /* Constant for version number in universal print record */
  316.  
  317. enum {
  318.     gxPrintRecordVersion        = 8
  319. };
  320.  
  321. /* Constants for feed field in universal print record */
  322.  
  323. enum {
  324.     gxAutoFeed                    = 0,
  325.     gxManualFeed                = 1
  326. };
  327.  
  328. /* Constants for options field in universal print record */
  329.  
  330. enum {
  331.     gxPreciseBitmap                = 0x0001,                        /* Tall adjusted (IW), precise bitmap (LW, SC) */
  332.     gxBiggerPages                = 0x0002,                        /* No gaps (IW), larger print area (LW) */
  333.     gxGraphicSmoothing            = 0x0004,                        /* Graphic smoothing (LW) */
  334.     gxTextSmoothing                = 0x0008,                        /* Text smoothing (SC) */
  335.     gxFontSubstitution            = 0x0010,                        /* Font substitution */
  336.     gxInvertPage                = 0x0020,                        /* B/W invert image */
  337.     gxFlipPageHoriz                = 0x0040,                        /* Flip horizontal */
  338.     gxFlipPageVert                = 0x0080,                        /* Flip vertical */
  339.     gxColorMode                    = 0x0100,                        /* Color printing */
  340.     gxBidirectional                = 0x0200,                        /* Bidirectional printing */
  341.     gxUserFlag0                    = 0x0400,                        /* User flag 0 */
  342.     gxUserFlag1                    = 0x0800,                        /* User flag 1 */
  343.     gxUserFlag2                    = 0x1000,                        /* User flag 2 */
  344.     gxReservedFlag0                = 0x2000,                        /* Reserved flag 0 */
  345.     gxReservedFlag1                = 0x4000,                        /* Reserved flag 1 */
  346.     gxReservedFlag2                = 0x8000                        /* Reserved flag 2 */
  347. };
  348.  
  349. /* Constants for orientation field in universal print record */
  350.  
  351. enum {
  352.     gxPortraitOrientation        = 0,
  353.     gxLandscapeOrientation        = 1,
  354.     gxAltPortraitOrientation    = 2,
  355.     gxAltLandscapeOrientation    = 3
  356. };
  357.  
  358. /* Constants for qualityMode field in universal print record */
  359.  
  360. enum {
  361.     gxBestQuality                = 0,
  362.     gxFasterQuality                = 1,
  363.     gxDraftQuality                = 2
  364. };
  365.  
  366. /* Constants for firstTray and remainingTray fields in universal print record */
  367.  
  368. enum {
  369.     gxFirstTray                    = 0,
  370.     gxSecondTray                = 1,
  371.     gxThirdTray                    = 2
  372. };
  373.  
  374. /* Constants for coverPage field in universal print record */
  375.  
  376. enum {
  377.     gxNoCoverPage                = 0,
  378.     gxFirstPageCover            = 1,
  379.     gxLastPageCover                = 2
  380. };
  381.  
  382. /* Constants for headMotion field in universal print record */
  383.  
  384. enum {
  385.     gxUnidirectionalMotion        = 0,
  386.     gxBidirectionalMotion        = 1
  387. };
  388.  
  389. /* Constants for saveFile field in universal print record */
  390.  
  391. enum {
  392.     gxNoFile                    = 0,
  393.     gxPostScriptFile            = 1
  394. };
  395.  
  396.  
  397. /* The format of the "universal" print record */
  398.  
  399. struct gxUniversalPrintRecord {
  400.     short                             printRecordVersion;            /* Print record version */
  401.                                                                 /* prInfo subrecord */
  402.     short                             appDev;                        /* Device kind, always 0 */
  403.     short                             appVRes;                    /* Application vertical resolution */
  404.     short                             appHRes;                    /* Application horizontal resolution */
  405.     Rect                             appPage;                    /* Page size, in application resolution */
  406.     Rect                             appPaper;                    /* Paper rectangle [offset from rPage] */
  407.                                                                 /* prStl subrecord */
  408.     short                             devType;                    /* Device type, always 0xA900 (was wDev) */
  409.     short                             pageV;                        /* Page height in 120ths of an inch */
  410.     short                             pageH;                        /* Page width in 120ths of an inch */
  411.     char                             fillByte;                    /* Page calculation mode */
  412.     char                             feed;                        /* Feed mode */
  413.                                                                 /* prInfoPT subrecord */
  414.     short                             devKind;                    /* Device kind, always 0 */
  415.     short                             devVRes;                    /* Device vertical resolution */
  416.     short                             devHRes;                    /* Device horizontal resolution */
  417.     Rect                             devPage;                    /* Device page size */
  418.                                                                 /* prXInfo subrecord */
  419.     short                             actualCopies;                /* Actual number of copies for this job */
  420.     short                             options;                    /* Options for this device */
  421.     short                             reduction;                    /* Reduce/enlarge factor */
  422.     char                             orientation;                /* Orientation of paper ( 0=portrait, 1=landscape ) */
  423.                                                                 /* Clusters and PopUps */
  424.     char                             qualityMode;                /* Quality mode */
  425.     char                             coverPage;                    /* Cover page */
  426.     char                             firstTray;                    /* First feed tray */
  427.     char                             remainingTray;                /* Remaining feed tray */
  428.     char                             headMotion;                    /* Head motion */
  429.     char                             saveFile;                    /* Save file */
  430.     char                             userCluster1;                /* Three clusters left over */
  431.     char                             userCluster2;
  432.     char                             userCluster3;
  433.                                                                 /* prJob subrecord */
  434.     short                             firstPage;                    /* First page */
  435.     short                             lastPage;                    /* Last page */
  436.     short                             copies;                        /* Number of copies, always 1 */
  437.     char                             reserved1;                    /* Always true, unused */
  438.     char                             reserved2;                    /* Always true, unused */
  439.     PrIdleUPP                         pIdleProc;                    /* Idle proc */
  440.     Ptr                             pFileName;                    /* Spool file name pointer */
  441.     short                             fileVol;                    /* Spool file vRefNum */
  442.     char                             fileVers;                    /* File version, must be 0 */
  443.     char                             reserved3;                    /* Always 0 */
  444.     short                             printX[19];                    /* Internal use */
  445. };
  446. typedef struct gxUniversalPrintRecord    gxUniversalPrintRecord;
  447. typedef gxUniversalPrintRecord *        gxUniversalPrintRecordPtr;
  448. typedef gxUniversalPrintRecordPtr *        gxUniversalPrintRecordHdl;
  449.  
  450. /* ------------------------------------------------------------------------------
  451.  
  452.                             Compatibility Printing Messages
  453.  
  454. -------------------------------------------------------------------------------- */
  455. #define Forward_GXPrOpenDoc(hPrint, pPort) \
  456.         ForwardThisMessage((void *) (hPrint), (void *) (pPort))
  457.  
  458. #define Forward_GXPrCloseDoc(pPort) \
  459.         ForwardThisMessage((void *) (pPort))
  460.  
  461. #define Forward_GXPrOpenPage(pPort, pRect, resolution) \
  462.         ForwardThisMessage((void *) (pPort), (void *) (pRect), (void *) (resolution))
  463.  
  464. #define Forward_GXPrClosePage(pPort) \
  465.         ForwardThisMessage((void *) (pPort))
  466.  
  467. #define Forward_GXPrintDefault(hPrint) \
  468.         ForwardThisMessage((void *) (hPrint))
  469.  
  470. #define Forward_GXPrStlDialog(hPrint, confirmed) \
  471.         ForwardThisMessage((void *) (hPrint), (void *) (confirmed))
  472.  
  473. #define Forward_GXPrJobDialog(hPrint, confirmed) \
  474.         ForwardThisMessage((void *) (hPrint), (void *) (confirmed))
  475.  
  476. #define Forward_GXPrStlInit(hPrint, pDlg) \
  477.         ForwardThisMessage((void *) (hPrint), (void *) (pDlg))
  478.  
  479. #define Forward_GXPrJobInit(hPrint, pDlg) \
  480.         ForwardThisMessage((void *) (hPrint), (void *) (pDlg))
  481.  
  482. #define Forward_GXPrDlgMain(hPrint, initProc, confirmed) \
  483.         ForwardThisMessage((void *) (hPrint), (void *) (initProc), (void *) (confirmed))
  484.  
  485. #define Forward_GXPrValidate(hPrint, changedPrintRecord) \
  486.         ForwardThisMessage((void *) (hPrint), (void *) (changedPrintRecord))
  487.  
  488. #define Forward_GXPrJobMerge(srcPrint, destPrint) \
  489.         ForwardThisMessage((void *) (srcPrint), (void *) (destPrint))
  490.  
  491. #define Forward_GXPrGeneral(dataPtr) \
  492.         ForwardThisMessage((void *) (dataPtr))
  493.  
  494. #define Forward_GXConvertPrintRecordTo(hPrint) \
  495.         ForwardThisMessage((void *) (hPrint))
  496.  
  497. #define Forward_GXConvertPrintRecordFrom(hPrint) \
  498.         ForwardThisMessage((void *) (hPrint))
  499.  
  500. #define Forward_GXPrintRecordToJob(hPrint, aJob) \
  501.         ForwardThisMessage((void *) (hPrint), (void *) (aJob))
  502.  
  503. /* ------------------------------------------------------------------------------
  504.  
  505.                         Raster Driver Contants and Types
  506.  
  507. -------------------------------------------------------------------------------- */
  508.  
  509. typedef long                             gxRasterPlaneOptions;
  510. /* Input structure for setting up the offscreen */
  511.  
  512. struct gxPlaneSetupRec {
  513.     gxRasterPlaneOptions             planeOptions;                /* Options for the offscreen package */
  514.     gxHalftone                         planeHalftone;                /* OPTIONAL: halftone structure for this plane */
  515.     gxColorSpace                     planeSpace;                    /* OPTIONAL: noSpace will get the graphics default */
  516.     gxColorSet                         planeSet;                    /* OPTIONAL: NIL gets the default */
  517.     gxColorProfile                     planeProfile;                /* OPTIONAL: NIL gets no matching */
  518. };
  519. typedef struct gxPlaneSetupRec            gxPlaneSetupRec;
  520. /* Constants for planeOptions field in gxPlaneSetupRec */
  521.  
  522. enum {
  523.     gxDefaultOffscreen            = 0x00000000,                    /* Default value - bits are allocated for the client, halftoning takes place */
  524.     gxDontSetHalftone            = 0x00000001,                    /* Don't call SetViewPortHalftone */
  525.     gxDotTypeIsDitherLevel        = 0x00000002                    /* Call SetViewPortDither using the dotType as the level */
  526. };
  527.  
  528.  
  529.  
  530. struct gxOffscreenSetupRec {
  531.     short                             width;                        /* Width in pixels */
  532.     short                             minHeight;                    /* Minimum height in pixels - actual height returned here */
  533.     short                             maxHeight;                    /* Maximum height in pixels */
  534.     Fixed                             ramPercentage;                /* Maximum percentage of RAM to take */
  535.     long                             ramSlop;                    /* Amount of RAM to be sure to leave */
  536.     short                             depth;                        /* Depths in bits of each plane */
  537.     gxMapping                         vpMapping;                    /* Mapping to assign to offscreen viewPorts */
  538.     gxMapping                         vdMapping;                    /* Mapping to assign to offscreen viewDevices */
  539.     short                             planes;                        /* Number of planes to allocate of depth bits each (can be more than 4) */
  540.     gxPlaneSetupRec                 planeSetup[4];                /* Parameters for each plane, 4 is provided because it is most handy for writers of devices */
  541. };
  542. typedef struct gxOffscreenSetupRec        gxOffscreenSetupRec;
  543.  
  544. /* The format of one plane in the offscreen planar area */
  545.  
  546. struct gxOffscreenPlaneRec {
  547.     gxViewPort                         theViewPort;                /* viewPort for the offscreen */
  548.     gxViewDevice                     theDevice;                    /* viewDevice for the offscreen */
  549.     gxViewGroup                     theViewGroup;                /* The viewGroup that they share */
  550.     gxShape                         theBitmap;                    /* The offscreen bitmap shape */
  551.     gxBitmap                         theBits;                    /* The bits of the offscreen */
  552. };
  553. typedef struct gxOffscreenPlaneRec        gxOffscreenPlaneRec;
  554.  
  555. /* The format of an entire offscreen area */
  556.  
  557. struct gxOffscreenRec {
  558.     short                             numberOfPlanes;                /* Number of planes we have */
  559.     Handle                             offscreenStorage;            /* Handle containing the bitmaps image data */
  560.     gxOffscreenPlaneRec             thePlanes[1];                /* Planes to draw in */
  561. };
  562. typedef struct gxOffscreenRec            gxOffscreenRec;
  563.  
  564. typedef gxOffscreenRec *                gxOffscreenPtr;
  565. typedef gxOffscreenPtr *                gxOffscreenHdl;
  566. typedef long                             gxRasterRenderOptions;
  567. /* Structure that mirrors 'rdip' resource. */
  568.  
  569. struct gxRasterPrefsRec {
  570.     gxRasterRenderOptions             renderOptions;                /* Options for the raster imaging system */
  571.     Fixed                             hImageRes;                    /* Horizontal resolution to image at */
  572.     Fixed                             vImageRes;                    /* Vertical resolution to image at */
  573.     short                             minBandSize;                /* Minimum band size to use (in pixels) */
  574.     short                             maxBandSize;                /* Maximum band size to use (in pixels), 0 == entire page */
  575.     Fixed                             ramPercentage;                /* Maximum percentage of RAM to take */
  576.     long                             ramSlop;                    /* Amount of RAM to be sure to leave */
  577.     short                             depth;                        /* Depth in pixels (PER PLANE!) */
  578.     short                             numPlanes;                    /* Number of planes to render */
  579.     gxPlaneSetupRec                 planeSetup[1];                /* One for each plane */
  580. };
  581. typedef struct gxRasterPrefsRec            gxRasterPrefsRec;
  582. /* Constants for renderOptions field in gxRasterPrefsRec. */
  583.  
  584. enum {
  585.     gxDefaultRaster                = 0x00000000,                    /* Default raster options */
  586.     gxDontResolveTransferModes    = 0x00000001,                    /* 0=Resolve, 1=Don't Resolve */
  587.     gxRenderInReverse            = 0x00000002,                    /* Traverse image in reverse order */
  588.     gxOnePlaneAtATime            = 0x00000004,                    /* Render each plane separately */
  589.     gxSendAllBands                = 0x00000008                    /* Send even empty bands */
  590. };
  591.  
  592.  
  593. typedef gxRasterPrefsRec *                gxRasterPrefsPtr;
  594. typedef gxRasterPrefsPtr *                gxRasterPrefsHdl;
  595. typedef long                             gxRasterPackageOptions;
  596. /* Structure that mirrors 'rpck' resource. */
  597.  
  598. struct gxRasterPackageRec {
  599.     Ptr                             bufferSize;                    /* Buffer size for packaging (>= maximum head pass size) */
  600.     short                             colorPasses;                /* 1 (b/w) or 4 (CMYK) is typical */
  601.     short                             headHeight;                    /* Printhead height in pixels */
  602.     short                             numberPasses;                /* Number of head passes it takes to == iHeadHeight */
  603.     short                             passOffset;                    /* Offset between passes, in pixels */
  604.     gxRasterPackageOptions             packageOptions;                /* Packaging options */
  605. };
  606. typedef struct gxRasterPackageRec        gxRasterPackageRec;
  607.  
  608. typedef gxRasterPackageRec *            gxRasterPackagePtr;
  609. typedef gxRasterPackagePtr *            gxRasterPackageHdl;
  610. /* Constants for packageOptions field in gxRasterPackageRec. */
  611.  
  612. enum {
  613.     gxSendAllColors                = 0x00000001,                    /* Send even clean bands through */
  614.     gxInterlaceColor            = 0x00000002,                    /* Ribbon contamination is a concern */
  615.     gxOverlayColor                = 0x00000004,                    /* Color printer without a ribbon problem */
  616.     gxUseColor                    = (gxInterlaceColor | gxOverlayColor) /* This is a color printer */
  617. };
  618.  
  619.  
  620. /* Structure for RasterPackageBitmap message */
  621.  
  622. struct gxRasterPackageBitmapRec {
  623.     gxBitmap *                        bitmapToPackage;            /* Bitmap containing the data to package */
  624.     unsigned short                     startRaster;                /* Raster to begin the packaging from */
  625.     unsigned short                     colorBand;                    /* For which color pass this is a packaging request */
  626.     Boolean                         isBandDirty;                /* Whether there are any dirty bits in this band */
  627.     char                             padByte;
  628.     Rect                             dirtyRect;                    /* Which bits are dirty */
  629. };
  630. typedef struct gxRasterPackageBitmapRec    gxRasterPackageBitmapRec;
  631.  
  632. /* Structure of number record in gxRasterPackageControlsRec */
  633.  
  634. struct gxStandardNumberRec {
  635.     short                             numberType;                    /* Type of numberic output desired */
  636.     short                             minWidth;                    /* Minimum output width of the number */
  637.     char                             padChar;                    /* Pad character for numbers shorter than the minWidth */
  638.     char                             padChar2;
  639.     Str31                             startString;                /* Prefix string */
  640.     Str31                             endString;                    /* Postfix string */
  641. };
  642. typedef struct gxStandardNumberRec        gxStandardNumberRec;
  643.  
  644. typedef gxStandardNumberRec *            gxStandardNumberPtr;
  645. /* Structure that mirrors 'ropt' resource */
  646.  
  647. struct gxRasterPackageControlsRec {
  648.     short                             startPageStringID;            /* 'wstr' to send to the device at start of page */
  649.     short                             formFeedStringID;            /* 'wstr' to send to the device to cause a form feed */
  650.     short                             forwardMax;                    /* Line feed strings */
  651.     gxStandardNumberRec             forwardLineFeed;            /* Number record for forward line feed */
  652.     short                             reverseMax;                    /* Max number of reverse line feeds device can do */
  653.     gxStandardNumberRec             reverseLineFeed;            /* Number record for forward line feed */
  654. };
  655. typedef struct gxRasterPackageControlsRec gxRasterPackageControlsRec;
  656.  
  657. typedef gxRasterPackageControlsRec *    gxRasterPackageControlsPtr;
  658. typedef gxRasterPackageControlsPtr *    gxRasterPackageControlsHdl;
  659. /* Raster imaging system imageData structure */
  660.  
  661. struct gxRasterImageDataRec {
  662.     gxRasterRenderOptions             renderOptions;                /* Options for the raster imaging system */
  663.     Fixed                             hImageRes;                    /* horizontal resolution to image at */
  664.     Fixed                             vImageRes;                    /* vertical resolution to image at */
  665.     short                             minBandSize;                /* smallest band that makes sense for this device */
  666.     short                             maxBandSize;                /* biggest band that makes sense, or 0 for "full page" */
  667.     gxRectangle                     pageSize;                    /* size of page for device */
  668.  
  669.                                                                 /* Values used within the RasterDataIn message */
  670.  
  671.     short                             currentYPos;                /* Current position moving down the page */
  672.     gxRasterPackageRec                 packagingInfo;                /* Raster packaging record */
  673.  
  674.                                                                 /* Values used within the remaining messages */
  675.  
  676.     Boolean                         optionsValid;                /* Were options specified by the driver? */
  677.     char                             padByte;
  678.     gxRasterPackageControlsRec         packageControls;            /* Options for the packaging messages */
  679.     gxOffscreenSetupRec             theSetup;                    /* setup for the offscreen code, variable length componant */
  680. };
  681. typedef struct gxRasterImageDataRec        gxRasterImageDataRec;
  682.  
  683. typedef gxRasterImageDataRec *            gxRasterImageDataPtr;
  684. typedef gxRasterImageDataPtr *            gxRasterImageDataHdl;
  685. /* ------------------------------------------------------------------------------
  686.  
  687.                                 Raster Driver Imaging Messages
  688.  
  689. -------------------------------------------------------------------------------- */
  690. #define Send_GXRasterDataIn(offScreen, bandRectangle, dirtyRectangle) \
  691.         MacSendMessage(0x00010000, offScreen, bandRectangle, dirtyRectangle)
  692.  
  693. #define Forward_GXRasterDataIn(offScreen, bandRectangle, dirtyRectangle) \
  694.         ForwardThisMessage((void *) (offScreen), (void *) (bandRectangle), (void *) (dirtyRectangle))
  695.  
  696. #define Send_GXRasterLineFeed(lineFeedSize, buffer, bufferPos, imageDataHdl) \
  697.         MacSendMessage(0x00010001, lineFeedSize, buffer, bufferPos, imageDataHdl)
  698.  
  699. #define Forward_GXRasterLineFeed(lineFeedSize, buffer, bufferPos, imageDataHdl) \
  700.         ForwardThisMessage((void *) (lineFeedSize), (void *) (buffer), (void *) (bufferPos), (void *) (imageDataHdl))
  701.  
  702. #define Send_GXRasterPackageBitmap(whatToPackage, buffer, bufferPos, imageDataHdl) \
  703.         MacSendMessage(0x00010002, whatToPackage, buffer, bufferPos, imageDataHdl)
  704.  
  705. #define Forward_GXRasterPackageBitmap(whatToPackage, buffer, bufferPos, imageDataHdl) \
  706.         ForwardThisMessage((void *) (whatToPackage), (void *) (buffer), (void *) (bufferPos), (void *) (imageDataHdl))
  707.  
  708. /* ------------------------------------------------------------------------------
  709.  
  710.                         Vector Driver Contants and Types
  711.  
  712. -------------------------------------------------------------------------------- */
  713. /* Vector device halftone component record */
  714.  
  715. struct gxVHalftoneCompRec {
  716.     Fixed                             angle;                        /* Angle to halftone at. Must be 0, 90, 45 or 135 */
  717.     long                             penIndex;                    /* index of the pen to draw this component with */
  718. };
  719. typedef struct gxVHalftoneCompRec        gxVHalftoneCompRec;
  720.  
  721. /* Vector device halftone record */
  722.  
  723. struct gxVHalftoneRec {
  724.     gxColorSpace                     halftoneSpace;
  725.     gxVHalftoneCompRec                 halftoneComps[4];            /* Info for each color component */
  726.     long                             penIndexForBW;                /* Pen index to draw one bit deep or black and white bitmap with */
  727. };
  728. typedef struct gxVHalftoneRec            gxVHalftoneRec;
  729.  
  730. /* Vector shape rendering information */
  731.  
  732. typedef long                             gxVectorShapeOptions;
  733.  
  734. struct gxVectorShapeDataRec {
  735.     gxVectorShapeOptions             shapeOptions;                /* Options to control shape handling */
  736.     long                             maxPolyPoints;                /* Maximum number of polygon points that device can support */
  737.     Fixed                             shapeError;                    /* Defines allowed deviation from the original shape */
  738.     Fixed                             textSize;                    /* Text above this size is filled; text below this size is outlined */
  739.     Fixed                             frameSize;                    /* Frame's smaller than this -> shape stroked; frame's larger -> shape is filled */
  740. };
  741. typedef struct gxVectorShapeDataRec        gxVectorShapeDataRec;
  742.  
  743. /* Constants for shapeOptions field in gxVectorShapeDataRec. */
  744.  
  745. enum {
  746.     gxUnidirectionalFill        = 0x00000001,                    /* Generate scanlines in one direction only.  Useful for transparencies */
  747.     gxAlsoOutlineFilledShape    = 0x00000002                    /* Turn on this bit to also outline solid filled shapes */
  748. };
  749.  
  750.  
  751. /* Vector device rendering information */
  752.  
  753. typedef long                             gxVectorRenderOptions;
  754. /* Vector imaging system imageData structure */
  755.  
  756. struct gxVectorImageDataRec {
  757.     gxVectorRenderOptions             renderOptions;                /* Options to control rendering: color sort, clipping, etc. */
  758.     Fixed                             devRes;                        /* Device resolution */
  759.     gxTransform                     devTransform;                /* Mapping, clip and halftoning information for colored bitmaps */
  760.     gxColorSet                         clrSet;                        /* Entire set of colors; usually indexed color space for pen plotters */
  761.     gxColor                         bgColor;                    /* The background color in the color space specified by the clrSpace field */
  762.     gxVHalftoneRec                     halftoneInfo;                /* Defines halftone information for color bitmaps */
  763.     gxPenTableHdl                     hPenTable;                    /* Complete list of pens along with their pen positions and thickness */
  764.     gxRectangle                     pageRect;                    /* Page dimensions */
  765.     gxVectorShapeDataRec             shapeData;                    /* Information on how to render a shape */
  766. };
  767. typedef struct gxVectorImageDataRec        gxVectorImageDataRec;
  768.  
  769. typedef gxVectorImageDataRec *            gxVectorImageDataPtr;
  770. typedef gxVectorImageDataPtr *            gxVectorImageDataHdl;
  771. /* Constants for renderOptions field in gxVectorImageDataRec. */
  772.  
  773. enum {
  774.     gxColorSort                    = 0x00000001,                    /* Set for pen plotters */
  775.     gxATransferMode                = 0x00000002,                    /* Set if transfer modes need to be resolved */
  776.     gxNoOverlap                    = 0x00000004,                    /* Set if non-overlapping output is desired*/
  777.     gxAColorBitmap                = 0x00000008,                    /* Set if color bitmap output is desired */
  778.     gxSortbyPenPos                = 0x00000010,                    /* Set if shapes are to be drawn in the order of the pen index */
  779.                                                                 /* in the pen table. NOTE: this is not the pen position in the carousel */
  780.     gxPenLessPlotter            = 0x00000020,                    /* Indicates raster printer/plotter */
  781.     gxCutterPlotter                = 0x00000040,                    /* Indicates cutter */
  782.     gxNoBackGround                = 0x00000080                    /* Set if shapes that map to the background color should not be sent to driver */
  783. };
  784.  
  785.  
  786. /* ------------------------------------------------------------------------------
  787.  
  788.                                 Vector Driver Imaging Messages
  789.  
  790. -------------------------------------------------------------------------------- */
  791. #define Send_GXVectorPackageShape(theShape, penIndex) \
  792.         MacSendMessage(0x00010000, theShape, penIndex)
  793.  
  794. #define Forward_GXVectorPackageShape(theShape, penIndex) \
  795.         ForwardThisMessage((void *) (theShape), (void *) (penIndex))
  796.  
  797. #define Send_GXVectorLoadPens(penTable, shapeCounts, penTableChanged) \
  798.         MacSendMessage(0x00010001, penTable, shapeCounts, penTableChanged)
  799.  
  800. #define Forward_GXVectorLoadPens(penTable, shapeCounts, penTableChanged) \
  801.         ForwardThisMessage((void *) (penTable), (void *) (shapeCounts), (void *) (penTableChanged))
  802.  
  803. #define Send_GXVectorVectorizeShape(theShape, penIndex, vectorData) \
  804.         MacSendMessage(0x00010002, theShape, penIndex, vectorData)
  805.  
  806. #define Forward_GXVectorVectorizeShape(theShape, penIndex, vectorData) \
  807.         ForwardThisMessage((void *) (theShape), (void *) (penIndex), (void *) (vectorData))
  808.  
  809. /* ------------------------------------------------------------------------------
  810.  
  811.                             PostScript Driver Contants and Types
  812.  
  813. -------------------------------------------------------------------------------- */
  814.  
  815. enum {
  816.     gxPostSynonym                = FOUR_CHAR_CODE('post')
  817. };
  818.  
  819. /* PostScript glyphs record */
  820.  
  821. struct gxPrinterGlyphsRec {
  822.  
  823.     gxFont                             theFont;                    /*  ---> Font reference */
  824.     long                             nGlyphs;                    /*  ---> Number of glyphs in the font */
  825.     gxFontPlatform                     platform;                    /* <---  How printer font is encoded */
  826.     gxFontScript                     script;                        /* <---  Script if platform != glyphPlatform */
  827.     gxFontLanguage                     language;                    /* <---  Language if platform != glyphPlatform */
  828.     long                             vmUsage;                    /* <---  How much PostScript VM font uses */
  829.  
  830.                                                                 /* Size of this array is long-alligned(nGlyphs) */
  831.     unsigned long                     glyphBits[1];                /* <---  Bit array of which system glyphs are in printer */
  832.  
  833. };
  834. typedef struct gxPrinterGlyphsRec        gxPrinterGlyphsRec;
  835.  
  836. /* PostScript device rendering information */
  837.  
  838. typedef long                             gxPostScriptRenderOptions;
  839.  
  840. struct gxPostScriptImageDataRec {
  841.     short                             languageLevel;                /* PostScript language level */
  842.     gxColorSpace                     devCSpace;                    /* The printer's color space */
  843.     gxColorProfile                     devCProfile;                /* The printer's color profile for matching */
  844.     gxPostScriptRenderOptions         renderOptions;                /* Options for the imaging system */
  845.     long                             pathLimit;                    /* Maximum path size */
  846.     short                             gsaveLimit;                    /* Maximum number of gsaves allowed */
  847.     short                             opStackLimit;                /* Operand stack limit */
  848.     scalerStreamTypeFlag             fontType;                    /* These are the font types that the printer supports  */
  849.     long                             printerVM;                    /* How much memory is in the printer */
  850.     long                             reserved0;
  851. };
  852. typedef struct gxPostScriptImageDataRec    gxPostScriptImageDataRec;
  853.  
  854. typedef gxPostScriptImageDataRec *        gxPostScriptImageDataPtr;
  855. typedef gxPostScriptImageDataPtr *        gxPostScriptImageDataHdl;
  856. /* Constants for renderOptions field in gxPostScriptImageDataRec. */
  857.  
  858. enum {
  859.     gxNeedsHexOption            = 0x00000001,                    /* Convert all binary data to hex */
  860.     gxNeedsCommentsOption        = 0x00000002,                    /* Issue PostScript comments */
  861.     gxBoundingBoxesOption        = 0x00000004,                    /* Calculate the values for */
  862.     gxPortablePostScriptOption    = 0x00000008,                    /* Generate portable PostScript */
  863.     gxTextClipsToPathOption        = 0x00000010,                    /* Convert all clips that are composed of text to path shapes */
  864.     gxFlattenClipPathOption        = 0x00000020,                    /* Convert all clips that are path shapes to polygons (helps better control point limit) */
  865.     gxUseCharpath1Option        = 0x00000040,                    /* (ignored if text clips are converted to paths)  When the clip is text,  */
  866.                                                                 /* Do it one glyph at a time, redrawing the main shape each time */
  867.     gxUseLevel2ColorOption        = 0x00000080,                    /* When printing to level-2 use level-2 device independent color */
  868.     gxNoEPSIllegalOperators        = 0x00000100,                    /* Don't use any operators prohibited by the Encapsulated PostScript File Format V3.0 */
  869.     gxEPSTargetOption            = gxNoEPSIllegalOperators + gxNeedsCommentsOption + gxBoundingBoxesOption, /* PostScript intended for EPS Use. */
  870.     gxPageIndependentPostScript    = 0x00000200                    /* Don't generate PostScript with page interdependencies */
  871. };
  872.  
  873.  
  874. /* Structure for gxPostScriptGetProcSetList / gxPostScriptDownLoadProcSetList */
  875.  
  876. struct gxProcSetListRec {
  877.     gxOwnerSignature                 clientid;
  878.     OSType                             controlType;                /* The driver will call FetchTaggedData on each of these resources */
  879.     short                             controlid;
  880.     OSType                             dataType;
  881.     long                             reserved0;
  882. };
  883. typedef struct gxProcSetListRec            gxProcSetListRec;
  884.  
  885. typedef gxProcSetListRec *                gxProcSetListPtr;
  886. typedef gxProcSetListPtr *                gxProcSetListHdl;
  887. /* Possible results of querying printer (returned by gxPostScriptQueryPrinter message) */
  888.  
  889. enum {
  890.     gxPrinterOK                    = 0,
  891.     gxIntializePrinter            = 1,
  892.     gxFilePrinting                = 2,
  893.     gxResetPrinter                = 128
  894. };
  895.  
  896.  
  897. /* ------------------------------------------------------------------------------
  898.  
  899.                                 PostScript Driver Imaging Messages
  900.  
  901. -------------------------------------------------------------------------------- */
  902. /* Device control messages */
  903. #define Send_GXPostScriptQueryPrinter(queryData) \
  904.         MacSendMessage(0x00010000, queryData)
  905.  
  906. #define Forward_GXPostScriptQueryPrinter(queryData) \
  907.         ForwardThisMessage((void *) (queryData))
  908.  
  909.  
  910. #define Send_GXPostScriptInitializePrinter() \
  911.         MacSendMessage(0x00010001)
  912.  
  913. #define Forward_GXPostScriptInitializePrinter() \
  914.         ForwardThisMessage((void *) (0))
  915.  
  916.  
  917. #define Send_GXPostScriptResetPrinter() \
  918.         MacSendMessage(0x00010002)
  919.  
  920. #define Forward_GXPostScriptResetPrinter() \
  921.         ForwardThisMessage((void *) (0))
  922.  
  923.  
  924. #define Send_GXPostScriptExitServer() \
  925.         MacSendMessage(0x00010003)
  926.  
  927. #define Forward_GXPostScriptExitServer() \
  928.         ForwardThisMessage((void *) (0))
  929.  
  930. /* Device communication messages */
  931. #define Send_GXPostScriptGetStatusText(textHdl) \
  932.         MacSendMessage(0x00010004, textHdl)
  933.  
  934. #define Forward_GXPostScriptGetStatusText(textHdl) \
  935.         ForwardThisMessage((void *) (textHdl))
  936.  
  937.  
  938. #define Send_GXPostScriptGetPrinterText(textHdl) \
  939.         MacSendMessage(0x00010005, textHdl)
  940.  
  941. #define Forward_GXPostScriptGetPrinterText(textHdl) \
  942.         ForwardThisMessage((void *) (textHdl))
  943.  
  944.  
  945. #define Send_GXPostScriptScanStatusText(textHdl) \
  946.         MacSendMessage(0x00010006, textHdl)
  947.  
  948. #define Forward_GXPostScriptScanStatusText(textHdl) \
  949.         ForwardThisMessage((void *) (textHdl))
  950.  
  951.  
  952. #define Send_GXPostScriptScanPrinterText(textHdl) \
  953.         MacSendMessage(0x00010007, textHdl)
  954.  
  955. #define Forward_GXPostScriptScanPrinterText(textHdl) \
  956.         ForwardThisMessage((void *) (textHdl))
  957. /* Proc set management messages */
  958. #define Send_GXPostScriptGetDocumentProcSetList(procSet, imageDataHdl) \
  959.         MacSendMessage(0x00010008, procSet, imageDataHdl)
  960.  
  961. #define Forward_GXPostScriptGetDocumentProcSetList(procSet, imageDataHdl) \
  962.         ForwardThisMessage((void *) (procSet), (void *) (imageDataHdl))
  963.  
  964. #define Send_GXPostScriptDownloadProcSetList(procSet, imageDataHdl) \
  965.         MacSendMessage(0x00010009, procSet, imageDataHdl)
  966.  
  967. #define Forward_GXPostScriptDownloadProcSetList(procSet, imageDataHdl) \
  968.         ForwardThisMessage((void *) (procSet), (void *) (imageDataHdl))
  969. /* Font management messages */
  970. #define Send_GXPostScriptGetPrinterGlyphsInformation(glyphsInfo) \
  971.         MacSendMessage(0x0001000A, glyphsInfo)
  972.  
  973. #define Forward_GXPostScriptGetPrinterGlyphsInformation(glyphsInfo) \
  974.         ForwardThisMessage((void *) (glyphsInfo))
  975.  
  976.  
  977. #define Send_GXPostScriptStreamFont(fontref, streamPtr) \
  978.         MacSendMessage(0x0001000B, fontref, streamPtr)
  979.  
  980. #define Forward_GXPostScriptStreamFont(fontref, streamPtr) \
  981.         ForwardThisMessage((void *) (fontref), (void *) (streamPtr))
  982. /* Document structuring and formatting messages */
  983. #define Send_GXPostScriptDoDocumentHeader(imageDataHdl) \
  984.         MacSendMessage(0x0001000C, imageDataHdl)
  985.  
  986. #define Forward_GXPostScriptDoDocumentHeader(imageDataHdl) \
  987.         ForwardThisMessage((void *) (imageDataHdl))
  988.     
  989. #define Send_GXPostScriptDoDocumentSetup(imageDataHdl) \
  990.         MacSendMessage(0x0001000D, imageDataHdl)
  991.  
  992. #define Forward_GXPostScriptDoDocumentSetup(imageDataHdl) \
  993.         ForwardThisMessage((void *) (imageDataHdl))
  994.  
  995. #define Send_GXPostScriptDoDocumentTrailer(imageDataHdl) \
  996.         MacSendMessage(0x0001000E, imageDataHdl)
  997.  
  998. #define Forward_GXPostScriptDoDocumentTrailer(imageDataHdl) \
  999.         ForwardThisMessage((void *) (imageDataHdl))
  1000. /* Page structuring and formatting messages */
  1001. #define Send_GXPostScriptDoPageSetup(pageFormat, thePage, imageDataHdl) \
  1002.         MacSendMessage(0x0001000F, pageFormat, thePage, imageDataHdl)
  1003.  
  1004. #define Forward_GXPostScriptDoPageSetup(pageFormat, thePage, imageDataHdl) \
  1005.         ForwardThisMessage((void *) (pageFormat), (void *) (thePage), (void *) (imageDataHdl))
  1006.  
  1007. #define Send_GXPostScriptSelectPaperType(thePapertype, thePage, imageDataHdl) \
  1008.         MacSendMessage(0x00010010, thePapertype, thePage, imageDataHdl)
  1009.  
  1010. #define Forward_GXPostScriptSelectPaperType(thePapertype, thePage, imageDataHdl) \
  1011.         ForwardThisMessage((void *) (thePapertype), (void *) (thePage), (void *) (imageDataHdl))
  1012.  
  1013. #define Send_GXPostScriptDoPageTrailer(imageDataHdl) \
  1014.         MacSendMessage(0x00010011, imageDataHdl)
  1015.  
  1016. #define Forward_GXPostScriptDoPageTrailer(imageDataHdl) \
  1017.         ForwardThisMessage((void *) (imageDataHdl))
  1018.  
  1019. #define Send_GXPostScriptEjectPage(thePapertype, pagenumber, copiescount, erasepage, imageDataHdl) \
  1020.         MacSendMessage(0x00010012, thePapertype, pagenumber, copiescount, erasepage, imageDataHdl)
  1021.  
  1022. #define Forward_GXPostScriptEjectPage(thePapertype, pagenumber, copiescount, erasepage, imageDataHdl) \
  1023.         ForwardThisMessage((void *) (thePapertype), (void *) (pagenumber), (void *) (copiescount), \
  1024.                            (void *) (erasepage), (void *) (imageDataHdl))
  1025.  
  1026. #define Send_GXPostScriptEjectPendingPage(pageWasEjected) \
  1027.         MacSendMessage(0x00010014, pageWasEjected)
  1028.  
  1029. #define Forward_GXPostScriptEjectPendingPage(pageWasEjected) \
  1030.         ForwardThisMessage((void *) (pageWasEjected))
  1031. /* Shape imaging messages */
  1032. #define Send_GXPostScriptProcessShape(page, trcount, trlist) \
  1033.         MacSendMessage(0x00010013, page, trcount, trlist)
  1034.  
  1035. #define Forward_GXPostScriptProcessShape(page, trcount, trlist) \
  1036.         ForwardThisMessage((void *) (page), (void *) (trcount), (void *) (trlist))
  1037. /* ------------------------------------------------------------------------------
  1038.  
  1039.                                             Driver API Functions
  1040.  
  1041. -------------------------------------------------------------------------------- */
  1042. /* Constants for printer gxViewDevice bitmaps. */
  1043.  
  1044. enum {
  1045.     gxMissingImagePointer        = -4
  1046. };
  1047.  
  1048. EXTERN_API_C( OSErr )
  1049. GXAddPrinterViewDevice            (gxPrinter                 thePrinter,
  1050.                                  gxViewDevice             theViewDevice)                        FOURWORDINLINE(0x203C, 0x0002, 0x0000, 0xABFE);
  1051.  
  1052. EXTERN_API_C( OSErr )
  1053. GXGetAvailableJobFormatModes    (gxJobFormatModeTableHdl * theFormatModes)                    FOURWORDINLINE(0x203C, 0x0002, 0x0001, 0xABFE);
  1054.  
  1055. EXTERN_API_C( OSErr )
  1056. GXSetPreferredJobFormatMode        (gxJobFormatMode         theFormatMode,
  1057.                                  Boolean                 directOnly)                            FOURWORDINLINE(0x203C, 0x0002, 0x0002, 0xABFE);
  1058.  
  1059. EXTERN_API_C( OSErr )
  1060. GXPrintingAlert                    (long                     iconId,
  1061.                                  long                     txtSize,
  1062.                                  long                     defaultTitleNum,
  1063.                                  long                     cancelTitleNum,
  1064.                                  long                     textLength,
  1065.                                  Ptr                     pAlertMsg,
  1066.                                  StringPtr                 actionTitle,
  1067.                                  StringPtr                 title2,
  1068.                                  StringPtr                 title3,
  1069.                                  StringPtr                 msgFont,
  1070.                                  ModalFilterUPP         filterProc,
  1071.                                  short *                itemHit,
  1072.                                  StringPtr                 alertTitle)                            FOURWORDINLINE(0x203C, 0x0002, 0x0003, 0xABFE);
  1073.  
  1074. EXTERN_API_C( OSErr )
  1075. GXGetPrintingAlert                (long                     alertResId,
  1076.                                  ModalFilterUPP         filterProc,
  1077.                                  short *                itemHit)                            FOURWORDINLINE(0x203C, 0x0002, 0x0004, 0xABFE);
  1078.  
  1079.  
  1080. EXTERN_API_C( OSErr )
  1081. GXFetchDTPData                    (Str31                     dtpName,
  1082.                                  OSType                 theType,
  1083.                                  long                     theID,
  1084.                                  Handle *                theData)                            FOURWORDINLINE(0x203C, 0x0002, 0x0005, 0xABFE);
  1085.  
  1086. EXTERN_API_C( OSErr )
  1087. GXWriteDTPData                    (Str31                     dtpName,
  1088.                                  OSType                 theType,
  1089.                                  long                     theID,
  1090.                                  Handle                 theData)                            FOURWORDINLINE(0x203C, 0x0002, 0x0006, 0xABFE);
  1091.  
  1092. EXTERN_API_C( OSErr )
  1093. GXHandleChooserMessage            (gxJob *                aJob,
  1094.                                  Str31                     driverName,
  1095.                                  long                     message,
  1096.                                  long                     caller,
  1097.                                  StringPtr                 objName,
  1098.                                  StringPtr                 zoneName,
  1099.                                  ListHandle             theList,
  1100.                                  long                     p2)                                    FOURWORDINLINE(0x203C, 0x0002, 0x0007, 0xABFE);
  1101.  
  1102.  
  1103. #if PRAGMA_STRUCT_ALIGN
  1104.     #pragma options align=reset
  1105. #elif PRAGMA_STRUCT_PACKPUSH
  1106.     #pragma pack(pop)
  1107. #elif PRAGMA_STRUCT_PACK
  1108.     #pragma pack()
  1109. #endif
  1110.  
  1111. #ifdef PRAGMA_IMPORT_OFF
  1112. #pragma import off
  1113. #elif PRAGMA_IMPORT
  1114. #pragma import reset
  1115. #endif
  1116.  
  1117. #ifdef __cplusplus
  1118. }
  1119. #endif
  1120.  
  1121. #endif /* __GXPRINTERDRIVERS__ */
  1122.  
  1123.